package com.qdu.servlet;

import com.qdu.entity.Journal;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.qdu.service.JournalService;
import com.qdu.service.impl.JournalServiceImpl;
import java.util.List;
import static jdk.nashorn.internal.runtime.Debug.id;

/**
 * 处理查询所有日志基本信息请求
 *
 * @author Lenovo
 */
@WebServlet("/sods")
public class SearchOneDiaryServlet extends HttpServlet {

    JournalService journalService = new JournalServiceImpl();
    
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        
        String jid=req.getParameter("jid");
        
        Journal j=journalService.searchJournalById(jid);

        req.setAttribute("jon", j);
             
        req.getRequestDispatcher("/diary_info.jsp").forward(req, resp);
        
    }
}
